package com.android.tea;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.android.tea.adapter.MyVisitorAdapter;
import com.android.tea.entity.TeaMember;

public class MyVisitorActivity extends Activity implements OnClickListener {
	ListView footprintList;
	TextView textView;
	private Button btnBack;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.footprint);
		footprintList = (ListView) findViewById(R.id.footprintLists);
		textView = (TextView) findViewById(R.id.title_this);
		textView.setText("我的访客");
		MyVisitorAdapter adapter = new MyVisitorAdapter(this, loadData());
		footprintList.setAdapter(adapter);
		btnBack = (Button) findViewById(R.id.btn_back);
		btnBack.setOnClickListener(this);
	}

	private List<TeaMember> loadData() {
		List<TeaMember> list = new ArrayList<TeaMember>();
		TeaMember member4 = new TeaMember();
		member4.setTitle("花相惜x1");
		member4.setTimeStamp(System.currentTimeMillis());
		list.add(member4);

		TeaMember member = new TeaMember();
		member.setTitle("花相惜x2");
		member.setTimeStamp(System.currentTimeMillis());
		list.add(member);

		TeaMember member1 = new TeaMember();
		member1.setTitle("花相惜x3");
		member1.setTimeStamp(System.currentTimeMillis());
		list.add(member1);

		TeaMember member2 = new TeaMember();
		member2.setTitle("花相惜x4");
		member2.setTimeStamp(System.currentTimeMillis());
		list.add(member2);

		TeaMember member3 = new TeaMember();
		member3.setTitle("花相惜x5");
		member3.setTimeStamp(System.currentTimeMillis());
		list.add(member3);

		TeaMember member5 = new TeaMember();
		member5.setTitle("花相惜x6");
		member5.setTimeStamp(System.currentTimeMillis());
		list.add(member5);

		return list;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_back:
			super.onBackPressed();
			break;

		default:
			break;

		}
	}
}